﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace 桌面视频录制
{
    [Serializable]
    public class DrawCoordinates : DrawLine
    {
        public override void Draw(System.Drawing.Graphics g)
        {
            Pen pen = new Pen(Color.Red);
            Font font = new Font("宋体", 10.0f, FontStyle.Regular, GraphicsUnit.Pixel);
            g.DrawLine(pen, new Point(0, 0), new Point(2100, 0));
            g.DrawLine(pen, new Point(0, 0), new Point(0, 2100));
            for (int i = 1; i < 210; i++)
            { 
                if (i % 5 == 0)
                {
                    g.DrawLine(pen, new Point(10 * i, 0), new Point(10 * i, 5));
                    g.DrawLine(pen, new Point(0, 10 * i), new Point(5, 10 * i));
                    g.DrawString("" + 10 * i, font, Brushes.Red, new PointF(10 * i, 6));
                    g.DrawString("" + 10 * i, font, Brushes.Red, new PointF(6, 10 * i));
                }
                else
                {
                    g.DrawLine(pen, new Point(10 * i, 0), new Point(10 * i, 3));
                    g.DrawLine(pen, new Point(0, 10 * i), new Point(3, 10 * i));
                }
            }
            pen.Dispose();
            pen = null;
            font.Dispose();
            font = null;
        }
    }
}
